package com.dht.xiao.jianye.activity;

import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.dht.xiao.jianye.R;
import com.dht.xiao.jianye.activity_bed.BedAllActivity;
import com.dht.xiao.jianye.activity_work_clothes.WorkAllActivity;
import com.dht.xiao.jianye.base.BaseActivity;
import com.licheedev.myutils.LogPlus;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class MainActivitynew extends BaseActivity {


    @BindView(R.id.seriesNum)
    TextView seriesNum;

    String ANDROID_ID;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_mainnew;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mainnew);
        ButterKnife.bind(this);
        getMachineCode();
    }

    private void getMachineCode() {
        ANDROID_ID =
                Settings.System.getString(getContentResolver(), Settings.System.ANDROID_ID);
        if (TextUtils.isEmpty(ANDROID_ID)) {
            ANDROID_ID = Build.SERIAL;
        }
        LogPlus.e("ANDROID_ID =" + ANDROID_ID);
        // ANDROID_ID = "6f4b9da9f38b5566";
        seriesNum.setText(ANDROID_ID);

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }


    @OnClick({R.id.bed, R.id.workclothes})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.bed:
                startActivity(BedAllActivity.class);
                break;
            case R.id.workclothes:
                startActivity(WorkAllActivity.class);
                break;
        }
    }
}

